var express = require('express');
var router = express.Router();
const {
    getOrders,
    deleteOrders,
    modifyOrders,
    addEvaluate,
    getHistoryOrders

} = require('../service/ordersService');

router.get('/getOrders', async function (req, res) {
    const params = req.query;
    const msg = await getOrders(params);
    res.send(msg);

});
router.post('/deleteOrders', async function (req, res) {
    const msg = await deleteOrders(req.body);
    res.send(msg);
});
router.post('/modifyOrders', async function (req, res) {
    const msg = await modifyOrders(req.body);
    res.send(msg);
});
router.post('/classifyOrders', async function (req, res) {
    const msg = await classifyOrders(req.body);
    res.send(msg);
});

//获取历史订单    廖冬 getHistoryOrders
router.post('/getHistoryOrders', async function (req, res) {
    console.log('------------历史第一层', req.body);
    const msg = await getHistoryOrders(req.body);
    res.send(msg)
});
//新增评价内容    廖冬


router.post('/addEvaluate', async function (req, res) {
    const msg = await addEvaluate(req.body);
    res.send(msg);
});

module.exports = router;